take the derivative of a trigonometric function